package com.base.logistics.jdl.bean.token;

import com.base.logistics.jdl.util.json.JdlGsonBuilder;

import java.io.Serializable;

/**
 * <pre>
 * token请求响应
 * </pre>
 * @since 2021-02-19
 */
public class TokenResult  implements Serializable {
    private Token model;
    private boolean success;
    private String errMsg;
    private String errCode;

    public TokenResult() {
    }

    public static TokenResult fromJson(String json) {
        return JdlGsonBuilder.create().fromJson(json, TokenResult.class);
    }

    public Token getModel() {
        return this.model;
    }

    public boolean isSuccess() {
        return this.success;
    }

    public String getErrMsg() {
        return this.errMsg;
    }

    public String getErrCode() {
        return this.errCode;
    }

    public void setModel(Token model) {
        this.model = model;
    }

    public void setSuccess(boolean success) {
        this.success = success;
    }

    public void setErrMsg(String errMsg) {
        this.errMsg = errMsg;
    }

    public void setErrCode(String errCode) {
        this.errCode = errCode;
    }

    public boolean equals(final Object o) {
        if (o == this) return true;
        if (!(o instanceof TokenResult)) return false;
        final TokenResult other = (TokenResult) o;
        if (!other.canEqual((Object) this)) return false;
        final Object this$model = this.getModel();
        final Object other$model = other.getModel();
        if (this$model == null ? other$model != null : !this$model.equals(other$model)) return false;
        if (this.isSuccess() != other.isSuccess()) return false;
        final Object this$errMsg = this.getErrMsg();
        final Object other$errMsg = other.getErrMsg();
        if (this$errMsg == null ? other$errMsg != null : !this$errMsg.equals(other$errMsg)) return false;
        final Object this$errCode = this.getErrCode();
        final Object other$errCode = other.getErrCode();
        if (this$errCode == null ? other$errCode != null : !this$errCode.equals(other$errCode)) return false;
        return true;
    }

    protected boolean canEqual(final Object other) {
        return other instanceof TokenResult;
    }

    public int hashCode() {
        final int PRIME = 59;
        int result = 1;
        final Object $model = this.getModel();
        result = result * PRIME + ($model == null ? 43 : $model.hashCode());
        result = result * PRIME + (this.isSuccess() ? 79 : 97);
        final Object $errMsg = this.getErrMsg();
        result = result * PRIME + ($errMsg == null ? 43 : $errMsg.hashCode());
        final Object $errCode = this.getErrCode();
        result = result * PRIME + ($errCode == null ? 43 : $errCode.hashCode());
        return result;
    }

    public String toString() {
        return "TokenResult(model=" + this.getModel() + ", success=" + this.isSuccess() + ", errMsg=" + this.getErrMsg() + ", errCode=" + this.getErrCode() + ")";
    }
}
